# 创建类
class LoginApi:
    # 定义属性
    def __init__(self):
        self.url_verify = "http://tpshop-test.itheima.net/index.php?m=Home&c=User&a=verify&r=0.7794573621727154"
        self.url_login = "http://tpshop-test.itheima.net/index.php?m=Home&c=User&a=do_login&t=0.4003948083916662"
        self.headers = {"Content-Type": "application/x-www-form-urlencoded"}

    # 定义方法 -- 获取验证码
    def get_verify(self, my_session):
        return my_session.get(url=self.url_verify)

    # 定义方法 -- 登录
    def login(self, my_session, reqData):
        return my_session.post(url=self.url_login, headers=self.headers, data=reqData)